<header class="panel-heading bg-light">
    帐户信息
</header>
<div class="form-group m-t">
    <label class="control-label">真实姓名：</label>
    <div class="col-sm-3 m-t-mc">{$row.byUser.real_name}</div>
    <label class="control-label">代理级别：</label>
    <div class="col-sm-3 ">
        <label>{$proxyLevel[$row['proxy_id']]['proxy_name']}</label>
        <a href="{:url('sys_admin.users/warrant',['user_id'=>$row['user_id']])}" data-toggle="ajaxModal" class="btn btn-sm btn-default m-l"><i class="fa fa-handshake-o"></i>授权</a>
    </div>
</div>
<div class="form-group">
    <label class="control-label">帐号状态：</label>
    <div class="col-sm-3 m-t-mc red">
        {$statusArr[$row['status']]}
    </div>

    <label class="control-label">授权结束时间：</label>
    <div class="col-sm-3 m-t-mc">
        {$row.warrant_end_time|dateTpl}
        {if condition="$row.warrant_end_time > 0 && $row.warrant_end_time < time()"}
        <span class="help-inline red">已过期</span>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="control-label">注册手机：</label>
    <div class="col-sm-3">
        <label>{$row.byUser.mobile}</label>
    </div>
    <label class="control-label">所属区域：</label>
    <div class="col-sm-3"><label>{$row.region_text}</label></div>
</div>
<div class="form-group">
    <label class="control-label">推荐上级：</label>
    <div class="col-sm-3 m-t-mc">
        {if condition="$row.pid > 0"}
        <a href="{:url('sys_admin.users/info',['user_id'=>$row['pid']])}" data-toggle="wrapperAjax">{$row.pid} - {$row.pid|userInfo=true,'real_name'}</a>
        {else/}
        厂家
        {/if}
    </div>
    <label class="control-label">进货上级：</label>
    <div class="col-sm-3 m-t-mc">
        {if condition="$row.supply_uid > 0"}
        <a href="{:url('sys_admin.users/info',['user_id'=>$row['supply_uid']])}" data-toggle="wrapperAjax">{$row.supply_uid} - {$row.supply_uid|userInfo=true,'real_name'}</a>
        {else/}
        厂家
        {/if}
    </div>
</div>
<div class="form-group">
    <label class="control-label">区域代理：</label>
    <div class="col-sm-3 m-t-mc">
        {$regionProxy[$row['region_proxy']]}
        <a href="{:url('sys_admin.users/regionProxy',['user_id'=>$row['user_id']])}" data-toggle="ajaxModal" class="btn btn-sm btn-default m-l"><i class="fa fa-handshake-o"></i>授权</a>
    </div>
</div>
<header>
    <ul class="nav nav-tabs">
        <li class="active"><a href="#tabInfo_{$row.user_id}" data-toggle="tab">基本信息</a></li>
        <li><a href="#tabBank_{$row.user_id}" data-toggle="tab">收款信息</a></li>
        <li><a href="#tabAddress_{$row.user_id}" data-toggle="tab">地址信息</a></li>
        <li><a href="#tabWarrant_{$row.user_id}" data-toggle="tab">授权列表</a></li>
        {if condition="$isTeamTree == 0 && $isWrapper == 0"}
        <li><a href="#tabSuperior_{$row.user_id}" class="superior_tab" data-user_id="{$row.user_id}" data-toggle="tab">推荐上级</a></li>
        <li><a href="#tabChain_{$row.user_id}" class="chain_tab" data-user_id="{$row.user_id}" data-toggle="tab">推荐团队(人数 - {$teamCount|intval})</a></li>
        {/if}
        <li><a href="#tabOptLog_{$row.user_id}" class="optlog_tab" data-user_id="{$row.user_id}" data-toggle="tab">操作日志</a></li>
    </ul>
</header>

<div class="tab-content">
    <div class="tab-pane active" id="tabInfo_{$row.user_id}">

        <div class="form-group">
            <label class="control-label">注册时间：</label>
            <div class="col-sm-3"><label>{$row.reg_time|dateTpl}</label></div>
            <label class="control-label">审核时间：</label>
            <div class="col-sm-3">
                <label>{$row.check_time|dateTpl}</label>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label">最近登陆时间：</label>
            <div class="col-sm-3"><label>{$row.login_time|dateTpl}</label></div>
            <label class="control-label">最近登陆IP：</label>
            <div class="col-sm-3"><label>{$row.login_ip|default='未记录'}</label></div>
        </div>
        <header class="panel-heading bg-light">
            帐户资产
        </header>
        <div class="form-group">
            <label class="control-label">云仓库存：</label>
            <div class="col-sm-3 m-t-mc">
                <a href="{:url('sys_admin.stock/info',array('user_id'=>$row['user_id']))}">{$stockStat.cloudStockTotal}</a>
            </div>
            <label class="control-label">实体库存：</label>
            <div class="col-sm-3 m-t-mc">
                <a href="{:url('sys_admin.stock/info',array('user_id'=>$row['user_id']))}">{$stockStat.entityStockTotal}</a>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label">保证金：</label>
            <div class="col-sm-3 m-t-mc">
                <a href="{:url('sys_admin.accountLog/index',array('user_id'=>$row['user_id']))}">{$row.account.earnest_money}元</a>
            </div>
            <label class="control-label">可用货款：</label>
            <div class="col-sm-3 m-t-mc">
                <a href="{:url('sys_admin.accountLog/index',array('user_id'=>$row['user_id']))}">{$row.account.goods_money}元</a>
            </div>

        </div>
        <div class="form-group">
            <label class="control-label">可用积分：</label>
            <div class="col-sm-3 m-t-mc">
                <a href="{:url('sys_admin.accountLog/index',array('user_id'=>$row['user_id']))}">{$row.account.balance_money}元</a>
            </div>
            <label class="control-label">累计提现：</label>
            <div class="col-sm-3 m-t-mc">
                <a href="{:url('sys_admin.accountLog/index',array('user_id'=>$row['user_id']))}">{$row.account.withdraw_money_total}元</a>
            </div>
        </div>
        <header class="panel-heading bg-light">
            实名认证 - <span class="red">{$checkIDCardStatus[$row['byUser']['check_id_card']]}</span>
            <a href="{:url('sys_admin.users/checkIdCard',['user_id'=>$row['user_id']])}" data-toggle="ajaxModal"
               class="btn btn-sm btn-default m-l"><i class="fa fa-drivers-license-o"></i>审核</a>
        </header>
        <div class="form-group">
            <label class="control-label">身份证号：</label>
            <div class="col-sm-3"><label>{$row.byUser.id_card_number}</label></div>
        </div>
        <div class="form-group">
            <label class="control-label">身份证图像：</label>
            <div class="col-sm-6 image-list">
                {if condition="$row.byUser.id_card_positive"}
                <img src="{$row.byUser.id_card_positive}" style="max-height: 100px;">
                {/if}
                {if condition="$row.byUser.id_card_back"}
                <img src="{$row.byUser.id_card_back}" style="max-height: 100px;">
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="control-label">电子签名：</label>
            <div class="col-sm-3 image-list">
                <img src="{$row.signature}" style="max-height: 100px;">
            </div>
        </div>


    </div>

    <!--收款帐号-->
    <div class="tab-pane" id="tabBank_{$row.user_id}" style="overflow: hidden">
        <div class="form-horizontal">
            <header class="panel-heading bg-light m-b-md">
                微信收款码 {$row['byUser']['weixin_usd']==0?'- 未设置/未启用':''}
            </header>
            <div class="{$row['byUser']['weixin_usd']==0?'hide':''}">
                <div class="form-group m-t-md">
                    <label class="control-label">微信昵称：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.weixin_name}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">微信号：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.weixin_account}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">收款二维码：</label>
                    <div class="col-sm-3">
                        <label>
                            <a href="{$row.byUser.weixin_qrcode}" target="_blank"><img src="{$row.byUser.weixin_qrcode}" style="max-height:100px;"></a>
                        </label>
                    </div>
                </div>
            </div>

            <header class="panel-heading bg-light m-b-md">
                支付宝收款码 {$row['byUser']['alipay_usd']==0?'- 未设置/未启用':''}
            </header>
            <div class="{$row['byUser']['alipay_usd']==0?'hide':''}">
                <div class="form-group m-t-md">
                    <label class="control-label">帐户姓名：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.alipay_name}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">支付宝帐号：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.alipay_account}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">收款二维码：</label>
                    <div class="col-sm-3">
                        <label>
                            <a href="{$row.byUser.alipay_qrcode}" target="_blank"><img src="{$row.byUser.alipay_qrcode}" style="max-height:100px;"></a>
                        </label>
                    </div>
                </div>
            </div>
            <header class="panel-heading bg-light m-b-md">
                银行卡收款 {$row['byUser']['bank_usd']==0?'- 未设置/未启用':''}
            </header>
            <div class="{$row['alipay_usd']==0?'hide':''}">
                <div class="form-group m-t-md">
                    <label class="control-label">开户银行：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.bank_name}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">银行所属省市：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.bank_region_text}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">开户支行：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.bank_subbranch}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">银行卡号：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.bank_card_number}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">持卡人名：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.bank_user_name}
                        </label>
                    </div>
                </div>
                <div class="form-group m-t-md">
                    <label class="control-label">持卡人身份号：</label>
                    <div class="col-sm-3">
                        <label>
                            {$row.byUser.bank_idcard_munber}
                        </label>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--地址信息-->
    <div class="tab-pane" id="tabAddress_{$row.user_id}" style="overflow: hidden">
        <table class="table table-bordered table-hover  m-b-none">
            <thead>
            <tr>
                <th width="100">默认</th>
                <th width="200">收货人</th>
                <th width="200">联系电话</th>
                <th>地址</th>
            </tr>
            </thead>
            <tbody>
            {volist name="row.user_address" id="ua" }
            <tr>
                <td><a href="javascript:;" class="{$ua['is_default']?'active':''}" data-fun="shelves"
                       data-toggle="class" data-ajax="true"><i class="fa fa-check text-success text-active"></i><i
                        class="fa fa-times text-danger text"></i></a></td>
                <td>{$ua.consignee}</td>
                <td>{$ua['mobile']}</td>
                <td>{$ua.merger_name} - {$ua.address}</td>
            </tr>
            {/volist}
            {empty name="row.user_address"}
            <tr>
                <td colspan="4" align="center" style="height:150px;">暂无收货地址信息！</td>
            </tr>
            {/empty}
            </tbody>
        </table>
    </div>
    <!--授权列表-->
    <div class="tab-pane" id="tabWarrant_{$row.user_id}" style="overflow: hidden">
        <table class="table table-bordered table-hover  m-b-none">
            <thead>
            <tr>
                <th width="80">id</th>
                <th width="200">授权码</th>
                <th width="150">授权层级</th>
                <th width="150">原代理层级</th>
                <th width="200">结束时间</th>
                <th width="200">操作者</th>
                <th width="200">操作时间</th>
            </tr>
            </thead>
            <tbody>
            {volist name="warrantLog" id="wa"}
            <tr>
                <td>{$wa.log_id}</td>
                <td>{$wa.warrant_number}</td>
                <td>{$proxyLevel[$wa['proxy_id']]['proxy_name']}</td>
                <td>{$proxyLevel[$wa['before_proxy_id']]['proxy_name']}</td>
                <td>{$wa.end_time|dateTpl}</td>
                <td>{$wa.operate_uid|adminInfo}</td>
                <td>{$wa.add_time|dateTpl}</td>
            </tr>
            {/volist}
            {empty name="warrantLog"}
            <tr>
                <td colspan="10" align="center" style="height:150px;">暂无授权信息！</td>
            </tr>
            {/empty}
            </tbody>
        </table>
    </div>

    <!--上级关系树-->
    <div class="tab-pane" id="tabSuperior_{$row.user_id}" style="overflow: hidden">
        <div class="form-group" style=" margin-left:0px;">
            <div class="col-sm-8">
                <button class="btn btn-sm btn-default" type="button"
                        data-remote="{:url('sys_admin.users/editSuperior',array('user_id'=>$row['user_id']))}" data-toggle="ajaxModal">
                    <i class="fa fa-edit"></i>修改所属上级
                </button>
            </div>
        </div>
        <div class="table-responsive"></div>
    </div>

    <!--下级关系树-->
    <div class="tab-pane" id="tabChain_{$row.user_id}" style="overflow: hidden">
        <div class="col-sm-3 m-t-md">
            <div id="MyTree2" class="tree tree-plus-minus">
                <div class="tree-folder" style="display: none;">
                    <div class="tree-folder-header">
                        <i class="fa fa-folder"></i>
                        <div class="tree-folder-name"></div>
                    </div>
                    <div class="tree-folder-content">
                    </div>
                    <div class="tree-loader" style="display: none;"></div>
                </div>
                <div class="tree-item" style="display: none;">
                    <i class="tree-dot"></i>
                    <div class="tree-item-name"></div>
                </div>
            </div>
        </div>
        <div class="col-sm-9 m-t-md" style=" float: right; ">
            <form  class="form-horizontal">
                <div id="team_chain_user_info"></div>
            </form>
        </div>
        <div class="clearfix m-b"></div>
    </div>
    <!--操作列表-->
    <div class="tab-pane" id="tabOptLog_{$row.user_id}"  style="overflow: hidden">
        <table class="table table-bordered table-hover  m-b-none" id="tabOptLogBox_{$row.user_id}">
            <thead>
            <tr>
                <th width="80">LOGID</th>
                <th width="200">操作用户</th>
                <th width="150">操作时间</th>
                <th>记录</th>
            </thead>
            <tbody></tbody>
        </table>
    </div>


</div>



